﻿namespace ManagementApi.Models
{
    public static class Exceptions
    {

        /// <summary>
        /// 手机号加密
        /// </summary>
        /// <param name="phoneNumber"></param>
        /// <returns></returns>
        public static string AsEncryptedPhone(this string phoneNumber)
        {
            if (string.IsNullOrEmpty(phoneNumber) || phoneNumber.Length != 11)
            {
                return "";
            }
            return phoneNumber.Substring(0, 3) + "****" + phoneNumber.Substring(7);
        }
    }
}
